<template>
  <div
    class="app-toast"
    v-if="isShow"
    :class="{
      info: type === 'info',
      success: type === 'success',
      warning: type === 'warning',
      danger: type === 'danger'
    }"
  >
    <div style="padding:8px 16px;">{{ text }}</div>
  </div>
</template>
<style scoped>
.app-toast {
  position: fixed;
  z-index: 999;
  width: 50%;
  left: 50%;
  top: 15%;
  background: #ccc;
  padding: 10px;
  border-radius: 5px;
  transform: translate(-50%, -50%);
  color: #fff;
  animation-name: fadeIn;
  animation-duration: 0.3s;
  animation-iteration-count: 1;
  animation-delay: 0s;
}
.info {
  background: #2196f3;
}
.success {
  background: #4caf50;
}
.warning {
  background: #eea300;
}
.danger {
  background: #ff5252;
}
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
</style>
